package gxdlxy.zx2201.chat5;

import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

public class Example7 {
    public static void main(String[] args) {
        long stampTime = System.currentTimeMillis();
        System.out.println("毫秒：" + stampTime);
        System.out.println("秒：" + stampTime/1000);
        // 时间戳 转 时间
        System.out.println(Instant.ofEpochMilli(stampTime));
        System.out.println(Instant.ofEpochSecond(stampTime / 1000));
        String time = "2023-06-16T07:48:43.787Z";
        // 时间 转 时间戳
        System.out.println(Instant.parse(time).getEpochSecond());

    }
}
